Skip to content

feat(server): infer commit and PR title style from repo history#1112

Open
binbandit wants to merge 5 commits intopingdotgg:mainfrom
binbandit:t3code/add-commit-pr-style-guidance
Open

feat(server): infer commit and PR title style from repo history#1112
binbandit wants to merge 5 commits intopingdotgg:mainfrom
binbandit:t3code/add-commit-pr-style-guidance

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 15, 2026

Summary

  • infer commit message style from recent repository commit subjects instead of hard-coding conventions
  • infer pull request title style from recent repository pull request titles when available, with recent commits as fallback context
  • default generated commit and pull request titles to Conventional Commits when the repository has no usable history

Testing

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run --cwd apps/server test src/git/Layers/CodexTextGeneration.test.ts src/git/Layers/GitCore.test.ts src/git/Layers/GitHubCli.test.ts src/git/Layers/GitManager.test.ts

Note

Infer commit and PR title style from repo history in Codex text generation

  • CodexTextGeneration now reads recent commit subjects via GitCore.readRecentCommitSubjects and recent PR titles via GitHubCli.listRecentPullRequestTitles before generating commit messages or PR content.
  • Style guidance is injected into the Codex prompt: when examples exist, they are deduped and capped; when none exist, the prompt defaults to Conventional Commits guidance.
  • Both lookups use short timeouts and swallow errors silently, returning empty lists on failure so generation always proceeds.
  • serverLayers wires GitCoreLive and GitHubCliLive into CodexTextGenerationLive to satisfy the new dependencies at runtime.
  • Behavioral Change: generated commit subjects and PR titles may now reflect repository-specific naming patterns rather than always defaulting to Conventional Commits style.

Macroscope summarized 2ae0665.

- add recent commit subject and PR title discovery for repo style guidance
- default generated commit and PR titles to conventional commits when history is unavailable
- cover the new prompt guidance and git/github lookups with tests
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8ffdf664-b059-4d70-9f7a-680eb4193922

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 15, 2026
Copy link
Contributor

@UtkarshUsername UtkarshUsername left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be fork-aware, and check the titles of PRs made to the original repo

),
Effect.map((pullRequests) => pullRequests.map(normalizePullRequestSummary)),
),
listRecentPullRequestTitles: (input) =>
Copy link
Contributor

@UtkarshUsername UtkarshUsername Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listRecentPullRequestTitles() uses gh pr list against the current checkout repo, right? So in a fork clone it gets PR titles from the fork, not the upstream repo

@binbandit
Copy link
Contributor Author

I think it should be fork-aware, and check the titles of PRs made to the original repo

I agree, but there is a different PR for that. Ill do it as part of that

@maria-rcks
Copy link
Collaborator

on this, it might be worth checking if the user has already had other prs / commtits and hand the agent that to write on the same style?

as an example i often like to write my prs without the cringy summary ask template and just say what i changed and stuff.

would love to know what other people think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants